/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.mto.quangcao.model.impl;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import com.mto.quangcao.model.QuangCao_banner;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing QuangCao_banner in entity cache.
 *
 * @author thanh.tran
 * @see QuangCao_banner
 * @generated
 */
public class QuangCao_bannerCacheModel implements CacheModel<QuangCao_banner>,
	Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(41);

		sb.append("{quangCaoId=");
		sb.append(quangCaoId);
		sb.append(", content=");
		sb.append(content);
		sb.append(", countView=");
		sb.append(countView);
		sb.append(", countClick=");
		sb.append(countClick);
		sb.append(", userId=");
		sb.append(userId);
		sb.append(", startDate=");
		sb.append(startDate);
		sb.append(", endDate=");
		sb.append(endDate);
		sb.append(", title=");
		sb.append(title);
		sb.append(", description=");
		sb.append(description);
		sb.append(", fileEntryId=");
		sb.append(fileEntryId);
		sb.append(", status=");
		sb.append(status);
		sb.append(", type=");
		sb.append(type);
		sb.append(", link=");
		sb.append(link);
		sb.append(", createDate=");
		sb.append(createDate);
		sb.append(", modifyDate=");
		sb.append(modifyDate);
		sb.append(", userModifyId=");
		sb.append(userModifyId);
		sb.append(", userModifyIp=");
		sb.append(userModifyIp);
		sb.append(", limitClick=");
		sb.append(limitClick);
		sb.append(", widthBanner=");
		sb.append(widthBanner);
		sb.append(", heightBanner=");
		sb.append(heightBanner);
		sb.append("}");

		return sb.toString();
	}

	public QuangCao_banner toEntityModel() {
		QuangCao_bannerImpl quangCao_bannerImpl = new QuangCao_bannerImpl();

		quangCao_bannerImpl.setQuangCaoId(quangCaoId);

		if (content == null) {
			quangCao_bannerImpl.setContent(StringPool.BLANK);
		}
		else {
			quangCao_bannerImpl.setContent(content);
		}

		quangCao_bannerImpl.setCountView(countView);
		quangCao_bannerImpl.setCountClick(countClick);
		quangCao_bannerImpl.setUserId(userId);

		if (startDate == Long.MIN_VALUE) {
			quangCao_bannerImpl.setStartDate(null);
		}
		else {
			quangCao_bannerImpl.setStartDate(new Date(startDate));
		}

		if (endDate == Long.MIN_VALUE) {
			quangCao_bannerImpl.setEndDate(null);
		}
		else {
			quangCao_bannerImpl.setEndDate(new Date(endDate));
		}

		if (title == null) {
			quangCao_bannerImpl.setTitle(StringPool.BLANK);
		}
		else {
			quangCao_bannerImpl.setTitle(title);
		}

		if (description == null) {
			quangCao_bannerImpl.setDescription(StringPool.BLANK);
		}
		else {
			quangCao_bannerImpl.setDescription(description);
		}

		quangCao_bannerImpl.setFileEntryId(fileEntryId);

		if (status == null) {
			quangCao_bannerImpl.setStatus(StringPool.BLANK);
		}
		else {
			quangCao_bannerImpl.setStatus(status);
		}

		if (type == null) {
			quangCao_bannerImpl.setType(StringPool.BLANK);
		}
		else {
			quangCao_bannerImpl.setType(type);
		}

		if (link == null) {
			quangCao_bannerImpl.setLink(StringPool.BLANK);
		}
		else {
			quangCao_bannerImpl.setLink(link);
		}

		if (createDate == Long.MIN_VALUE) {
			quangCao_bannerImpl.setCreateDate(null);
		}
		else {
			quangCao_bannerImpl.setCreateDate(new Date(createDate));
		}

		if (modifyDate == Long.MIN_VALUE) {
			quangCao_bannerImpl.setModifyDate(null);
		}
		else {
			quangCao_bannerImpl.setModifyDate(new Date(modifyDate));
		}

		quangCao_bannerImpl.setUserModifyId(userModifyId);

		if (userModifyIp == null) {
			quangCao_bannerImpl.setUserModifyIp(StringPool.BLANK);
		}
		else {
			quangCao_bannerImpl.setUserModifyIp(userModifyIp);
		}

		quangCao_bannerImpl.setLimitClick(limitClick);
		quangCao_bannerImpl.setWidthBanner(widthBanner);
		quangCao_bannerImpl.setHeightBanner(heightBanner);

		quangCao_bannerImpl.resetOriginalValues();

		return quangCao_bannerImpl;
	}

	public long quangCaoId;
	public String content;
	public long countView;
	public long countClick;
	public long userId;
	public long startDate;
	public long endDate;
	public String title;
	public String description;
	public long fileEntryId;
	public String status;
	public String type;
	public String link;
	public long createDate;
	public long modifyDate;
	public long userModifyId;
	public String userModifyIp;
	public long limitClick;
	public long widthBanner;
	public long heightBanner;
}